package com.sanjiahantang.youjiarole.module.me.quotation.beans;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import org.json.JSONException;
import org.json.JSONObject;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by zy on 2017/11/15.
 */

public class ContractRequestBean {

    private String contractCode;
    private String customerName;
    private String designName;
    private int mgiId;
    private int pcId;
    private String phone;
    private int requireId;
    private String roleId;
    private String rolePhone;
    private String serviceCount;
    private int serviceNum;
    private String servicePrice;
    private String signer1;
    private String signer2;
    private String skuId;
    private String token;
    private String pspId;
    private int isDesignFree;

    public int getIsDesignFree() {
        return isDesignFree;
    }

    public void setIsDesignFree(int isDesignFree) {
        this.isDesignFree = isDesignFree;
    }

    public String getPspId() {
        return pspId;
    }

    public void setPspId(String pspId) {
        this.pspId = pspId;
    }

    public static ContractRequestBean objectFromData(String str) {

        return new Gson().fromJson(str, ContractRequestBean.class);
    }

    public static ContractRequestBean objectFromData(String str, String key) {

        try {
            JSONObject jsonObject = new JSONObject(str);

            return new Gson().fromJson(jsonObject.getString(str), ContractRequestBean.class);
        } catch (JSONException e) {
            e.printStackTrace();
        }

        return null;
    }

    public static List<ContractRequestBean> arrayContractRequestBeanFromData(String str) {

        Type listType = new TypeToken<ArrayList<ContractRequestBean>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public static List<ContractRequestBean> arrayContractRequestBeanFromData(String str, String key) {

        try {
            JSONObject jsonObject = new JSONObject(str);
            Type listType = new TypeToken<ArrayList<ContractRequestBean>>() {
            }.getType();

            return new Gson().fromJson(jsonObject.getString(str), listType);

        } catch (JSONException e) {
            e.printStackTrace();
        }

        return new ArrayList();


    }

    public String getContractCode() {
        return contractCode;
    }

    public void setContractCode(String contractCode) {
        this.contractCode = contractCode;
    }



    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }

    public String getDesignName() {
        return designName;
    }

    public void setDesignName(String designName) {
        this.designName = designName;
    }

    public int getMgiId() {
        return mgiId;
    }

    public void setMgiId(int mgiId) {
        this.mgiId = mgiId;
    }

    public int getPcId() {
        return pcId;
    }

    public void setPcId(int pcId) {
        this.pcId = pcId;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public int getRequireId() {
        return requireId;
    }

    public void setRequireId(int requireId) {
        this.requireId = requireId;
    }

    public String getRoleId() {
        return roleId;
    }

    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }

    public String getRolePhone() {
        return rolePhone;
    }

    public void setRolePhone(String rolePhone) {
        this.rolePhone = rolePhone;
    }

    public String getServiceCount() {
        return serviceCount;
    }

    public void setServiceCount(String serviceCount) {
        this.serviceCount = serviceCount;
    }

    public int getServiceNum() {
        return serviceNum;
    }

    public void setServiceNum(int serviceNum) {
        this.serviceNum = serviceNum;
    }

    public String getServicePrice() {
        return servicePrice;
    }

    public void setServicePrice(String servicePrice) {
        this.servicePrice = servicePrice;
    }

    public String getSigner1() {
        return signer1;
    }

    public void setSigner1(String signer1) {
        this.signer1 = signer1;
    }

    public String getSigner2() {
        return signer2;
    }

    public void setSigner2(String signer2) {
        this.signer2 = signer2;
    }

    public String getSkuId() {
        return skuId;
    }

    public void setSkuId(String skuId) {
        this.skuId = skuId;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }
}
